//
//  FPLoginView.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/23.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPLoginView.h"

@implementation FPLoginView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
       
        self.MyView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kImageH(80))];
        self.MyView.backgroundColor = [UIColor colorWithRed:0.6 green:0.86 blue:0.8 alpha:1];
        [self addSubview:_MyView];
        self.picImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 20, kImageW(20), kImageW(20))];
        self.picImage.image = [UIImage imageNamed:@"group-vector"];
      //  self.picImage.backgroundColor = [UIColor greenColor];
        [self.MyView addSubview:_picImage];
        self.lineView  = [[UIView alloc]initWithFrame:CGRectMake(kImageW(40), kImageH(40), kScreenWidth - kImageW(40), kImageH(2))];
        self.lineView.backgroundColor = [UIColor redColor];
        [self addSubview:_lineView];
        //账号
        self.numTextFiled = [[UITextField alloc]initWithFrame:CGRectMake(self.picImage.width +self.picImage.x + kImageH(5),  kImageH(15), kScreenWidth - self.picImage.width, kImageH(30))];
    
        self.numTextFiled.clearButtonMode = UITextFieldViewModeWhileEditing;
  //      self.numTextFiled.backgroundColor = [UIColor redColor];
        self.numTextFiled.borderStyle =   UITextBorderStyleNone;
           [self.MyView addSubview:_numTextFiled];

        //密码
        self.pswImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, kImageH(60), kImageW(20), kImageW(20))];
        self.pswImage.image = [UIImage imageNamed:@"lock-vector.png"];
       // self.pswImage.backgroundColor = [UIColor redColor];
        [self.MyView addSubview:_pswImage];
        
        self.pswTextFiled = [[UITextField alloc]initWithFrame:CGRectMake(self.pswImage.width +self.pswImage.x+kImageH(5),kImageH(50), kScreenWidth - self.pswImage.width, kImageH(40))];
                self.pswTextFiled.borderStyle =   UITextBorderStyleNone;
        self.pswTextFiled.secureTextEntry = YES;
        [self.MyView addSubview:_pswTextFiled];

        self.loginButton = [UIButton buttonWithType:UIButtonTypeSystem];
             self.loginButton.frame = CGRectMake((kImageW(100))/2,self.MyView.height +self.MyView.y + kImageW(20), kScreenWidth - 2 *kImageW(50), kImageW(30));
        self.loginButton.layer.masksToBounds = YES;
        self.loginButton.layer.cornerRadius = 10;
        self.loginButton.backgroundColor = [UIColor redColor];
        [self.loginButton setTintColor: [UIColor purpleColor]];
        self.loginButton.titleLabel.font = [UIFont systemFontOfSize:20];
        [self.loginButton setTitle:@"登录" forState:UIControlStateNormal];
        [self addSubview:_loginButton];
        
        self.registerBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.registerBtn.frame = CGRectMake((kScreenWidth - kImageW(100))/2, self.loginButton.y +self.loginButton.height +kImageH(30), kImageW(100), kImageH(20));
        [self.registerBtn setTitle:@"免费注册" forState:UIControlStateNormal];
        [self addSubview:_registerBtn];
        
//        self.findPsw = [UIButton buttonWithType:UIButtonTypeSystem];
//        self.findPsw.frame = CGRectMake(kImageW(290), self.loginButton.y +self.loginButton.height +kImageH(30), kImageW(75), kImageH(20));
//        [self.findPsw setTitle:@"找回密码" forState :UIControlStateNormal];
//        [self addSubview:_findPsw];
        
        
        self.introLabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenWidth - kImageW(300))/2, self.registerBtn.y + self.registerBtn.height + kImageH(80),kImageW(300), kImageH(20))];
        self.introLabel.text = @"------------------------- 第三方登录 -------------------------";
        self.introLabel.font = [UIFont systemFontOfSize:11];
        self.introLabel.textColor = [UIColor redColor];
        self.introLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_introLabel];
        
        //微博按钮
        
        
        self.weiboBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.weiboBtn.frame = CGRectMake(kImageW(100), kImageW(300), kImageW(40), kImageW(40));
        [self.weiboBtn setBackgroundImage:[UIImage imageNamed:@"pic_share_weibosina"] forState:UIControlStateNormal];
        [self.weiboBtn.layer setCornerRadius:kImageW(40)/2];
        self.weiboBtn.layer.masksToBounds = YES;
        [self addSubview:_weiboBtn];
        
        
        self.QQbtn = [UIButton buttonWithType:UIButtonTypeSystem];
        self.QQbtn.frame = CGRectMake(kImageW(240), kImageW(300), kImageW(40), kImageW(40));
        [self.QQbtn.layer setCornerRadius:kImageW(40)/2];
         [self.QQbtn setBackgroundImage:[UIImage imageNamed:@"pic_share_qq@2x"] forState:UIControlStateNormal];
        self.QQbtn.layer.masksToBounds = YES;
        [self addSubview:_QQbtn];
        
        

    }
    return self;
}

@end
